package com.shopping.commons.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.shopping.model.AdminInfo;
import com.shopping.response.UserResp;

/**
 * 基础  Controller   提供基础功能
 * @author Administrator
 *
 */
@Controller
@RequestMapping("front/user") 
public class BaseController  {

	/**
	 * 获取管理员对象
	 * @param request
	 * @return
	 */
	public AdminInfo getAdmin(HttpServletRequest request){
		return (AdminInfo) request.getSession().getAttribute("adminInfo");
	}
	
	/**
	 * 获取前台用户对象
	 * @param request
	 * @return
	 */
	public UserResp getUser(HttpServletRequest request){
		return (UserResp) request.getSession().getAttribute("userInfo");
	}
}
